package com.c8a.validation.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 校验三:分组校验
 *
 * @Author C8A
 * @Date 2022-04-23 21:21
 * @Email 1912327276@qq.com
 */

@Data
@NoArgsConstructor
public class Employee {
    /**
     * 分组只要是interface即可
     */
    public interface Query {
    }

    /**
     * 添加校验
     */
    public interface Add {
    }

    /**
     * 修改校验
     */
    public interface Edit {
    }

    @NotNull(groups = {Query.class, Edit.class},message = "id不能为空")
    private Integer id;

    @NotEmpty(groups = {Query.class, Add.class},message = "name不能为空")
    private String name;

    @Valid
    private StudentVO studentVO;

}
